-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: add checkpoints at task start, attempt_completion, and mode switch #8460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add checkpoint creation at task start to allow reverting to the beginning - Add checkpoint creation when attempt_completion is called to mark task completion - Add checkpoint creation before mode switches to preserve state before mode change - All checkpoints use suppressMessage flag to keep timeline clean Fixes #8458
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review: auditing my own code like a mirror test that calls introspect().
| // Create a checkpoint at task start to allow reverting to the beginning | ||
| // Use allowEmpty=true to ensure checkpoint is created even with no file changes | ||
| // Suppress the checkpoint_saved chat row to keep the timeline clean | ||
| await this.checkpointSave(true, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2 — Avoid blocking the task loop: checkpointSave() is designed to run in the background; awaiting here delays the first API call. Fire-and-forget to keep startup responsive.
| await this.checkpointSave(true, true) | |
| void this.checkpointSave(true, true) |
| // Create a checkpoint before switching modes | ||
| // Use allowEmpty=true to ensure checkpoint is created even with no file changes | ||
| // Suppress the checkpoint_saved chat row to keep the timeline clean | ||
| await cline.checkpointSave(true, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2 — UX latency: awaiting checkpoint here blocks the mode switch on git I/O. Consider non-blocking; the checkpoint will still be recorded, and the mode switch remains snappy.
| await cline.checkpointSave(true, true) | |
| void cline.checkpointSave(true, true) |
|
Fixed |
Summary
This PR addresses Issue #8458 by adding checkpoints at three critical points in the task lifecycle to enable easy reverting of changes.
Changes
attempt_completionis called to mark the task completion stateAll checkpoints use:
allowEmpty=trueto ensure checkpoint creation even without file changessuppressMessage=trueto keep the timeline clean and avoid UI clutterTesting
Review Confidence
Code review confidence: 85% (HIGH)
Future Improvements
Consider adding specific unit tests for checkpoint creation at these trigger points to ensure the behavior is maintained.
Fixes #8458
Important
Add checkpoints at task start, attempt completion, and mode switch to enable state reverting, with options to ensure creation and suppress UI messages.
Task.tsto revert to initial state.attemptCompletionTool.tswhenattempt_completionis called to mark task completion.switchModeTool.tsbefore mode switch to preserve state.allowEmpty=trueto ensure creation without file changes.suppressMessage=trueto avoid UI clutter.This description was created by
for c9ea9fc. You can customize this summary. It will automatically update as commits are pushed.